import request from '@/common/request'

// 登录
// 查询原材料表
export function material(a,b,c,d) {
  return request({
    url: `/quality/material/list?name=${a}&batch=${b}&status=${c}&pageNum=${d}`,
    method: 'get',
    // params: query
  })
}
// 初始化表单

export function initMaterialForm(query) {
    return request({
      url: '/quality/material/initMaterialForm',
      method: 'get',
      params: query
    })
  }
// 新增单个空白表单
export function createMaterialDetailByMainId(query) {
    return request({
      url: '/quality/material/createMaterialDetailByMainId',
      method: 'get',
      params: query
    })
  }
  // 复制
  export function copyMaterialDetailByDetailId(query) {
    return request({
      url: '/quality/material/copyMaterialDetailByDetailId',
      method: 'get',
      params: query
    })
  }

  // 删除单个id
  export function deletePmMaterialDetail(query) {
    return request({
      url: '/quality/material/deletePmMaterialDetail',
      method: 'get',
      params: query
    })
  }
   //原材料入库-移动端-列表
  export function getAppMaterialList(query) {
    return request({
      url: '/quality/material/getAppMaterialList',
      method: 'get',
      params: query
    })
  }
  // 保存
  export function savePmMaterial(query) {
    return request({
      url: '/quality/material/savePmMaterial',
      method: 'post',
      data: query,
    })
  }
   // 提交
  export function submitPmMaterial(query) {
    return request({
      url: '/quality/material/submitPmMaterial',
      method: 'post',
      data: query,
    })
  }

  // 详情
   export function getMaterialDetailByMainId(query) {
    return request({
      url: `/quality/material/getMaterialDetailByMainId?pmMaterialMainId=${query}`,
      method: 'get',
      params: query
    })
  }
export function addMaterial(query) {
    return request({
      url: '/quality/material/add',
      method: 'post',
      data: query,
    })
  }
  export function submitPmToInspect(query) {
    return request({
      url: '/quality/pmToInspect/submitPmToInspect',
      method: 'post',
      data: query,
    })
  }
  export function inquirestaff(query) {
    return request({
      url: `/quality/common/getProjectCompanyUsers/${query}/supervise`,
      
      method: 'get',
    //   params: query
    })
  }
  //材料详情
export function viewDetails(file) {
        return request({
           url: `/quality/material/info/${file}`,
          method: 'get',
          // data:file
        })
      }
	  //编辑原材料
export function updateMaterial(query) {
    return request({
      url: '/quality/material/update',
      method: 'post',
      data: query
    })
  }
  //删除原材料
  
        export function deleteMaterial(id) {
          return request({
            url: `/quality/material/delete?id=${id}`,
            method: 'post',
      //       data:{
  				// id:id
      //       }
          })
        }
		
//原材料审批
      export function Approve(query) {
        return request({
          url: '/quality/material/materialCheckSubmit',
          method: 'post',
          data: query
        })
      }